package com.core.sdk.utils;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;

@SuppressLint("NewApi")
public class ClipboardUtil {
	public static void copy(String content, Context context) {

		// 得到剪贴板管理器
		android.content.ClipboardManager cmb = (android.content.ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
		cmb.setText(content.trim());

	}

	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public static String paste(Context context) {
		String str = null;
		android.content.ClipboardManager cmb = (android.content.ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
		str = cmb.getText().toString().trim();

		return str;
	}
}
